home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / doors_1 / doorskl3.zip / XBBSMSG.ZIP / XMSG.H < prev   
C/C++ Source or Header  |  1991-12-26  |  6KB  |  130 lines

  1. typedef unsigned int word;
  2.  
  3. #ifndef MSGERRS
  4.  
  5.     /* return values for functions in this module.  Also check errno */
  6.  
  7.     #define MSG_NOERR       0
  8.     #define MSG_NOACCESS    1
  9.     #define MSG_NOOPEN      2
  10.     #define MSG_NOMEM       3
  11.     #define MSG_NOSEEK      4
  12.     #define MSG_NOLOCK      5
  13.     #define MSG_NOUNLZSS    6
  14.     #define MSG_REDUCED     7
  15.     #define MSG_NOTEXT      8
  16.     #define MSG_BADAREA     9
  17.     #define MSG_BADNUM      10
  18.     #define MSG_NOREAD      11
  19.     #define MSG_PARTREAD    12
  20.  
  21.     #define MSGERRS
  22. #endif
  23.  
  24. /*-------------------------------------------------------------------------*/
  25. /* XBBS Message header                                                     */
  26. /*-------------------------------------------------------------------------*/
  27. struct __xmsg__ {
  28.       char from[36];
  29.       char to[36];
  30.       char subj[64];
  31.       unsigned int o_point;
  32.       unsigned int length;         /* Length of message */
  33.      unsigned long start;          /* Starting postition in text file              */
  34.       char date[20];
  35.       unsigned int times;          /* Number of times read                         */
  36.       unsigned int dest;           /* Destination node                             */
  37.       unsigned int orig;           /* Origination node number                      */
  38.       unsigned int cost;           /* Unit cost charged to send the message        */
  39.       unsigned int orig_net;       /* Origination network number                   */
  40.       unsigned int dest_net;       /* Destination network number                   */
  41.       char indate[4];              /* import date  (YMD(null))                     */
  42.       unsigned int m_attr;         /* Extra attributes                             */
  43.       unsigned int d_zone;         /* Destination zone                             */
  44.       unsigned int o_zone;         /* Origination zone                             */
  45.       unsigned int attr;           /* Attribute (behavior) of the message          */
  46.       unsigned int d_point;
  47. };
  48.  
  49. typedef struct __xmsg__ XMSG;
  50.  
  51. /* These apply to m_attr */
  52.  
  53. #define MSGDELETED 0x0001  /* deleted message,          0000 0000 0000 0001*/
  54. #define MSGANON    0x0002  /* anonymous message         0000 0000 0000 0010*/
  55. #define MSGECHO    0x0004  /* unmoved echo message      0000 0000 0000 0100*/
  56. #define MSGNET     0x0008  /* unmoved net message       0000 0000 0000 1000*/
  57. #define MSGHOLD    0x0010  /* file attached to msg      0000 0000 0001 0000*/
  58. #define MSGHOST    0x0020  /* being forwarded           0000 0000 0010 0000*/
  59. #define MSGSCANNED 0x0040  /* fidonet scanned           0000 0000 0100 0000*/
  60. #define MSGKEEP    0x0080  /* don't delete              0000 0000 1000 0000*/
  61. #define MSGTREATED 0x0100  /* soft cr's & lf's removed  0000 0001 0000 0000*/
  62. #define MSGPACKED  0x0200  /* message LZSS compressed   0000 0010 0000 0000*/
  63. #define MSGGSCAN   0x0400  /* groupmail scanned         0000 0100 0000 0000*/
  64. #define MSGRSCAN   0x0800  /* rfc0822 scanned           0000 1000 0000 0000*/
  65. /*#define    0x1000  /*  0001 0000 0000 0000*/
  66. /*#define    0x2000  /*  0010 0000 0000 0000*/
  67. /*#define    0x4000  /*  0100 0000 0000 0000*/
  68. #define MSGTAGGED  0x8000  /* used by offline readers   1000 0000 0000 0000*/
  69.  
  70.  
  71. /* FIDO Message attributes (attr)                                           */
  72.  
  73. #define MSGPRIVATE 0x0001  /* private message,          0000 0000 0000 0001 */
  74. #define MSGCRASH   0x0002  /* accept for forwarding     0000 0000 0000 0010 */
  75. #define MSGREAD    0x0004  /* read by addressee         0000 0000 0000 0100 */
  76. #define MSGSENT    0x0008  /* sent OK (remote)          0000 0000 0000 1000 */
  77. #define MSGFILE    0x0010  /* file attached to msg      0000 0000 0001 0000 */
  78. #define MSGFWD     0x0020  /* being forwarded           0000 0000 0010 0000 */
  79. #define MSGORPHAN  0x0040  /* unknown dest node         0000 0000 0100 0000 */
  80. #define MSGKILL    0x0080  /* kill after mailing        0000 0000 1000 0000 */
  81. #define MSGLOCAL   0x0100  /* FidoNet vs. local         0000 0001 0000 0000 */
  82. #define MSGXX1     0x0200  /*                           0000 0010 0000 0000 */
  83. #define MSGXX2     0x0400  /* STRIPPED by FidoNet<tm>   0000 0100 0000 0000 */
  84. #define MSGFRQ     0x0800  /* file request              0000 1000 0000 0000 */
  85. #define MSGRRQ     0x1000  /* receipt requested         0001 0000 0000 0000 */
  86. #define MSGCPT     0x2000  /* is a return receipt       0010 0000 0000 0000 */
  87. #define MSGARQ     0x4000  /* audit trail requested     0100 0000 0000 0000 */
  88. #define MSGURQ     0x8000  /* update request            1000 0000 0000 0000 */
  89.  
  90. typedef struct {
  91.     XMSG *hdr;
  92.     char *text;
  93.     word numptrs;
  94.     char **ptrs;
  95.     unsigned int ctla:  1;
  96.     unsigned int resv:  7;
  97. } IMSG;
  98.  
  99. /* LZSS routines in xbbslzss.c */
  100.  
  101. char * _fastcall unpack_msg (XMSG *msg,char **hold);
  102. char * _fastcall pack_msg (XMSG *msg,char *hold);
  103.  
  104. /* primitive message access functions in getput.c */
  105.  
  106. int _fastcall get_text (char **hold,XMSG *msg,unsigned int areano,
  107.                         unsigned int messno);
  108. int _fastcall append_text (XMSG *msg,char *hold,unsigned int areano,
  109.                            unsigned int messno);
  110. int _fastcall replace_text (XMSG *msg,char *hold,unsigned int areano,
  111.                             unsigned int messno);
  112. int _fastcall get_mess (XMSG *msg,unsigned int areano,unsigned int messno);
  113. int _fastcall put_mess (XMSG *msg,unsigned int areano,unsigned int messno);
  114. int _fastcall post_message (XMSG *msg,char **hold,unsigned int areano,int isfile);
  115.  
  116. /* index a message body, in idxmsg.c */
  117.  
  118. int _fastcall index_msg (IMSG *m,int width);
  119.  
  120. /* miscellaneous message area functions in miscmsg.c */
  121.  
  122. unsigned int _fastcall how_many_msgs (unsigned int areano);
  123.  
  124. /* packet creation/writing functions in makepkt.c */
  125.  
  126. int  _fastcall open_pkt (char *filename,AN_ADDR *hisaddr,AN_ADDR *myaddr);
  127. int  _fastcall write_pkt_msg (int fp,XMSG *amsg,char *text,char *area);
  128. void _fastcall close_pkt (void);
  129.  
  130.